<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改职称/资格证书')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-title-edit" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input name="id" type="hidden" id="id" th:value="${title.ID}"/>
        <h4 class="form-header h4">职称/资格证书</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">职称/资格证书名称：</label>
                    <div class="col-sm-8">
                        <input name="title" id="title" th:value="${title.Title}"class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">获得日期：</label>
                    <div class="col-sm-8">
                        <input name="EffectDate" id="EffectDate"th:value="${title.effectdate}" class="form-control laydate-demo-1" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证书编号：</label>
                    <div class="col-sm-8">
                        <input name="CertNo" id="CertNo"th:value="${title.certNo}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">备注：</label>
                    <div class="col-sm-8">
                        <input name="Remark" id="Remark"th:value="${title.Remark}"  class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "entryManage/EntryBackground";

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-title-edit").serializeArray();

            var id = $("#id").val();

            //职称/资格证书名称
            var title = $("#title").val();

            //获得日期
            var EffectDate = $("#EffectDate").val();

            //证书编号
            var CertNo = $("#CertNo").val();

            //备注
            var Remark = $("#Remark").val();

            data.push({"name": "id", "value": id});
            data.push({"name": "title", "value": title});
            data.push({"name": "EffectDate", "value": EffectDate});
            data.push({"name": "CertNo", "value": CertNo});
            data.push({"name": "Remark", "value": Remark});
            $.operate.save(prefix + "/editTitle", data);

        }
    }


</script>
</body>
</html>
